.class public final Lcom/farmis/feedme/triggers/QuestionNumberTrigger;
.super Lcom/farmis/feedme/abs/AbsTrigger;
.source "QuestionNumberTrigger.kt"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/farmis/feedme/abs/AbsTrigger<",
        "Ljava/lang/Integer;",
        ">;"
    }
.end annotation


# static fields
.field public static final INSTANCE:Lcom/farmis/feedme/triggers/QuestionNumberTrigger;

.field private static final default:I = 0x0

# The value of this static final field might be set in the static constructor
.field private static final key:Ljava/lang/String; = "feed_me_question_number_trigger"

.field private static final threshHold:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 12
    new-instance v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;

    invoke-direct {v0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;-><init>()V

    sput-object v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->INSTANCE:Lcom/farmis/feedme/triggers/QuestionNumberTrigger;

    const-string v0, "feed_me_question_number_trigger"

    .line 13
    sput-object v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->key:Ljava/lang/String;

    .line 15
    sget-object v0, Lcom/farmis/feedme/Conf;->Companion:Lcom/farmis/feedme/Conf$Companion;

    invoke-virtual {v0}, Lcom/farmis/feedme/Conf$Companion;->getIns()Lcom/farmis/feedme/Conf;

    move-result-object v0

    invoke-virtual {v0}, Lcom/farmis/feedme/Conf;->getQuestionNumber()I

    move-result v0

    sput v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->threshHold:I

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .line 12
    invoke-direct {p0}, Lcom/farmis/feedme/abs/AbsTrigger;-><init>()V

    return-void
.end method


# virtual methods
.method public add(Landroid/content/Context;)V
    .locals 2

    const-string v0, "c"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 22
    invoke-virtual {p0, p1}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->get(Landroid/content/Context;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    .line 23
    invoke-static {p1}, Lcom/farmis/feedme/utils/UtilsKt;->sp(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object p1

    invoke-virtual {p0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->getKey()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    invoke-static {p1, v1, v0}, Lcom/farmis/feedme/utils/UtilsKt;->set(Landroid/content/SharedPreferences;Ljava/lang/String;Ljava/lang/Object;)V

    return-void
.end method

.method public get(Landroid/content/Context;)Ljava/lang/Integer;
    .locals 2

    const-string v0, "c"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 27
    invoke-static {p1}, Lcom/farmis/feedme/utils/UtilsKt;->sp(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object p1

    invoke-virtual {p0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->getKey()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->getDefault()Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    invoke-interface {p1, v0, v1}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result p1

    .line 28
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    return-object p1
.end method

.method public getDefault()Ljava/lang/Integer;
    .locals 1

    .line 14
    sget v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->default:I

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    return-object v0
.end method

.method public getKey()Ljava/lang/String;
    .locals 1

    .line 13
    sget-object v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->key:Ljava/lang/String;

    return-object v0
.end method

.method public getThreshHold()Ljava/lang/Integer;
    .locals 1

    .line 15
    sget v0, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->threshHold:I

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    return-object v0
.end method

.method public isTriggered(Landroid/content/Context;)Z
    .locals 2

    const-string v0, "c"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 32
    invoke-virtual {p0, p1}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->get(Landroid/content/Context;)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    invoke-virtual {p0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->getThreshHold()Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    if-ge v0, v1, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    .line 33
    :goto_0
    invoke-virtual {p0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->getThreshHold()Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    invoke-virtual {p0, p1, v1}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->set(Landroid/content/Context;I)V

    return v0
.end method

.method public set(Landroid/content/Context;I)V
    .locals 1

    const-string v0, "c"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 18
    invoke-static {p1}, Lcom/farmis/feedme/utils/UtilsKt;->sp(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object p1

    invoke-virtual {p0}, Lcom/farmis/feedme/triggers/QuestionNumberTrigger;->getKey()Ljava/lang/String;

    move-result-object v0

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p2

    invoke-static {p1, v0, p2}, Lcom/farmis/feedme/utils/UtilsKt;->set(Landroid/content/SharedPreferences;Ljava/lang/String;Ljava/lang/Object;)V

    return-void
.end method
